package com.a1anwang.okble.server.advertise;

import ohos.bluetooth.ble.BleAdvertiseCallback;

/**
 * Created by a1anwang.com on 2018/5/30.
 */
public interface OKBLEAdvertiseCallback {
    /**
     * Failed to start advertising as the advertise data to be broadcasted is larger than 31 bytes.
     */
    int ADVERTISE_FAILED_DATA_TOO_LARGE = BleAdvertiseCallback.RESULT_FAIL_DATA_ILLEGAL;

    /**
     * Failed to start advertising because no advertising instance is available.
     */
    int ADVERTISE_FAILED_TOO_MANY_ADVERTISERS = BleAdvertiseCallback.RESULT_FAIL_TOO_MANY_ADVERTISERS;

    /**
     * Failed to start advertising as the advertising is already started.
     */
    int ADVERTISE_FAILED_ALREADY_STARTED = BleAdvertiseCallback.RESULT_FAIL_ALREADY_STARTED;
    /**
     * Operation failed due to an internal error.
     */
    int ADVERTISE_FAILED_INTERNAL_ERROR = BleAdvertiseCallback.RESULT_FAIL_ERROR;

    /**
     * This feature is not supported on this platform.
     */
    int ADVERTISE_FAILED_FEATURE_UNSUPPORTED = BleAdvertiseCallback.RESULT_FAIL_FEATURE_UNSUPPORTED;
    /**
     * This feature is ADVERTISE_FAILED_NULL_ADVERTISER
     */
    int ADVERTISE_FAILED_NULL_ADVERTISER = 0x10;

    /**
     * 成功
     */
    void onStartSuccess();

    /**
     * Callback when advertising could not be started.
     *
     * @param errorCode Error code (see ADVERTISE_FAILED_* constants) for advertising startfailures.
     * @param errMsg    errMsg
     */
    void onStartFailure(int errorCode, String errMsg);
}
